package com.itheima.health.dao;

import com.github.pagehelper.Page;
import com.itheima.health.pojo.CheckGroup;
import com.itheima.health.pojo.User;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author ：zhang
 * @date ：Created in 2019/11/20
 * @description ：用户DAO
 * @version: 1.0
 */
public interface UserDao {

    /**
     * 根据userName查询
     * @param username
     * @return
     */
    User selectByUsername(@Param("username") String username);

    Page<User> selectByCondition(@Param("queryString") String queryString);

    void insert(User user);

    void deleteUserById(@Param("id") Integer id);

    void deleteUserAndRoleBy(@Param("id") Integer id);

    User findById(Integer id);

    List<Integer> findroleIdsByUserId(Integer id);

    void update(User user);

    void insertUserAndRole(@Param("userId") Integer id, @Param("roleId") Integer roleId);
}

